package com.lipaluma.annotations.mapping;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.lipaluma.field.mapper.multiple.MultipleFieldMapper;

/**
 * This annotation is mandatory if user want concatenate several columns on one field.
 * <p>
 * Care, the concatenation has to be assigned to a String field. But by default, the String type is associated with a StringColumn.<br>
 * Use the annotation {@link MapWith} to overload the column mapper.
 * 
 * @author Mario
 */
@Documented
@Inherited
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface MapMultiplePathes {
	/**
	 * column names to concatenate. If empty, the indexes must be filled
	 */
	String[] pathes() default {};

	/**
	 * the path will be present on the result marshalled even if the value is empty
	 * @return
	 */
	boolean mandatoryPresence() default false;

	/**
	 * allows to keep all values from all columns even if the value is blank or null.<br>
	 *  - If true : keep all<br>
	 *  - If false : don't keep blanks and null values
	 */
	boolean keepAll() default false;

	/**
	 * optional : pattern how to parse or format values
	 */
	String pattern() default "";

	/**
	 * optional : locale used to define the locale for a date or a numeric value.
	 */
	String locale() default "";

	/**
	 * optional : separator between each tokens
	 */
	String separator() default "";

	/**
	 * optional : default value is false
	 */
	boolean eachValueRequired() default false;

	/**
	 * optional : default value is false
	 */
	boolean required() default false;
	
	/**
	 * trim : default value is false
	 */
	boolean trim() default false;

	Class<? extends MultipleFieldMapper> with();

}
